<template>
  <div class="tabbar">
    <van-tabbar
      v-model="active"
      active-color="var(--primary-color)"
      route>
      <van-tabbar-item
        v-for="item in tabbarData"
        :key="item.path"
        :to="item.path">
        <span>{{item.text}}</span>
        <template #icon="props">
          <img :src="props.active ? getAssetUrl(item.imageActive) : getAssetUrl(item.image)" />
        </template>
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script setup>
import tabbarData from "@/assets/data/tabbar";
import getAssetUrl from "@/utils/getAssetUrl";
import { ref } from "vue"
const active = ref(0)
</script>

<style lang="less" scoped>
.tabbar {
  img {
    height: 26px;
  }
}
</style>
